# coding: utf-8
import requests
from hytest import *
from setting import *


# noinspection SpellCheckingInspection
class APILogin:
    
    tags = ['登录功能', '冒烟测试']
    ddt_cases = [
        {
            "name": "mobile empty",
            "para": [None, '123456']
        }, {
            "name": "password empty",
            "para": ['17802156775', None]
        }, {
            "name": "error mobile",
            "para": ['17802156', '123456']
        }, {
            "name": "error password",
            "para": ['17802156123', '111111']
        }, {
            "name": "empty args",
            "para": [None, None]
        }
    ]

    # noinspection PyShadowingNames
    def teststeps(self):
        mobile, password = self.para
        
        payLoad = {
            "mobile": mobile,
            "password": password
        }
        res = requests.post(url, data=payLoad, headers=headers)
        CHECK_POINT('是否登陆成功', res.status_code == 200)
